﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace MINERP.BLL.CustomerManage
{
    public class CheckOrderInfoBLL
    {
            //参数
            private DAL.CustomerManage.CheckOrderInfoDAL dal = new MINERP.DAL.CustomerManage.CheckOrderInfoDAL();
            public List<CheckPhoto> GetPhotosByOrderProductCode(string orderProductCode)
            {
                try
                {
                    List<CheckPhoto> photos = new List<CheckPhoto>();
                    DataTable dt = dal.GetPhotoByOrderProductCode(orderProductCode);
                    foreach (DataRow r in dt.Rows)
                    {
                        CheckPhoto photo = new CheckPhoto();
                        photo.OrderProductCode = r["OrderProductCode"].ToString();
                        photo.OrderProductName = r["OrderProductName"].ToString();
                        photo.PhotoBarCode = r["PhotoBarCode"].ToString();
                        photo.PicPath = r["PicPath"].ToString();
                        photo.PhotoRemark = r["PhotoRemark"].ToString();
                        photo.CtmName = r["CtmName"].ToString();
                        photo.ShopName = r["ShopName"].ToString();
                        photos.Add(photo);
                    }
                    return photos;
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }

            public DataTable FindOrderInfo(string ctmName)
            {
                try
                {
                    return dal.GetOrderInfoByCtmName(ctmName);
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }

            //数据结构
            public class CheckPhoto
            {
                public string PhotoBarCode { get; set; }
                public string PicPath { get; set; }
                public string PhotoRemark { get; set; }
                public string OrderProductCode { get; set; }
                public string OrderProductName { get; set; }
                public string CtmName { get; set; }
                public string ShopName { get; set; }
            }

            public class OrderInfoCL
            {
                public string OrderProductCode { get; set; }
                public string OrderProductName { get; set; }
            }
    }
}
